//mac os
package basic

import (
	"gitee.com/hakwolf/taibak/internal/modules/utils"
	"gopkg.in/macaron.v1"
)

var (
	dataType      = []string{"sqlserver", "mysql", "oracle"} //这个是增加的数据库主机的类型
	mssqlversion  = []string{"sql2000", "sql2005", "sql2008", "sql2014", "sql2017", "sql2018", "sql2019"}
	sql_agreement = []string{"ado方式", "直连"}
)

//
func GetDataType(ctx *macaron.Context) string {
	jsonResp := utils.JsonResponse{}
	var xxJsonary []utils.Jsonstrt
	//xxJsonary = make([]Jsonstrt,0)
	xxJsonary = make([]utils.Jsonstrt, 1) //1下拉上面留个空选项
	for _, v := range dataType {
		jsonstr := utils.Jsonstrt{v, v}
		xxJsonary = append(xxJsonary, jsonstr)
	}
	return jsonResp.Success(utils.SuccessContent, xxJsonary)
}

//
func GetMssqlType(ctx *macaron.Context) string {
	jsonResp := utils.JsonResponse{}
	var xxJsonary []utils.Jsonstrt
	//xxJsonary = make([]Jsonstrt,0)
	xxJsonary = make([]utils.Jsonstrt, 1) //1下拉上面留个空选项
	for _, v := range mssqlversion {
		jsonstr := utils.Jsonstrt{v, v}
		xxJsonary = append(xxJsonary, jsonstr)
	}
	return jsonResp.Success(utils.SuccessContent, xxJsonary)
}
